import { BasicColumn } from '/@/components/Table'
import { FormSchema } from '/@/components/Table'
export const columns: BasicColumn[] = [
	{
		title: '人员编号',
		dataIndex: 'binderCode',
		width: 150,
		align: 'center',
		sorter: true,
	},
	{
		title: '人员姓名',
		dataIndex: 'binderName',
		width: 150,
		align: 'center',
		sorter: true,
	},
	{
		title: '时间',
		dataIndex: 'ariseTime',
		width: 150,
		align: 'center',
		sorter: true,
	},
	{
		title: '心率值',
		dataIndex: 'heartRate',
		width: 150,
		align: 'center',
		sorter: true,
	},
	{
		title: '体温',
		dataIndex: 'bodyTemperature',
		width: 150,
		align: 'center',
		sorter: true,
	},
	{
		title: '舒张压',
		dataIndex: 'bloodPressureLow',
		width: 150,
		align: 'center',
		sorter: true,
	},
	{
		title: '收缩压',
		dataIndex: 'bloodPressureHigh',
		width: 150,
		align: 'center',
		sorter: true,
	},
]

export const formSchema: FormSchema[] = [
	{
		field: 'id',
		label: '',
		component: 'Input',
		show: false,
	},
	{
		label: '绑定者',
		field: 'binderId',
		component: 'rwSelect',
		componentProps: {
			type: 'ward',
			label: 'name',
			key: 'id',
			xhrParams: {
				data: 'data',
			},
		},
	},
	{
		label: '设备',
		field: 'deviceId',
		component: 'rwSelect',
		componentProps: {
			type: 'ward',
			label: 'name',
			key: 'id',
			xhrParams: {
				data: 'data',
			},
		},
	},
	{
		label: '归属区域',
		field: 'belongAreaId',
		component: 'rwSelect',
		componentProps: {
			type: 'ward',
			label: 'name',
			key: 'id',
			xhrParams: {
				data: 'data',
			},
		},
	},
]

export const searchFormSchema: FormSchema[] = [
	{
		field: 'bindType',
		label: '近期绑定者',
		component: 'Select',
		defaultValue: 7,
		required: true,
		componentProps: () => {
			return {
				options: [
					{ label: '近三天', value: 3 },
					{ label: '近七天', value: 7 },
					{ label: '近半月', value: 15 },
					{ label: '近一月', value: 30 },
				],
			}
		},
	},
	{
		label: '绑定者',
		field: 'binderId',
		component: 'rwSelect',
		required: true,
		componentProps: ({ formModel }) => {
			return {
				type: 'patient',
				label: 'binderName',
				keyValue: 'binderId',
				watchParams: 'days',
				xhrParams: {
					data: 'data',
					days: formModel.bindType || 7,
				},
			}
		},
	},
	{
		field: 'StartEndTime',
		label: '',
		component: 'RangeDate',
		colProps: { span: 4, xxl: 5 },
		componentProps: {
			valueFormat: 'YYYY-MM-DD',
			// showTime: true,
		},
	},
]
